import Vue from 'vue'
import VueRouter from 'vue-router'

import BuildingView from "@/views/BuildingView.vue";
import MainView from "@/views/MainView.vue";
import SystemMenuView from "@/views/SystemMenuView.vue";
import RoleView from "@/views/RoleView.vue";
import PersonView from "@/views/PersonView.vue";
import SysUserView from "@/views/SysUserView.vue";
import ZyOwnerView from "@/views/ZyOwnerView.vue";
import TestView from "@/views/TestView.vue";
import ZyRepairView from "@/views/ZyRepairView.vue";
import ZyCommunityView from "@/views/ZyCommunityView.vue";
import zyOwnerRoomView from "@/views/ZyOwnerRoomView.vue";

import VisitorView from "@/views/VisitorView.vue";
import deptView from "@/views/DeptView.vue";
import DeptView from "@/views/DeptView.vue";
import IndexView from "@/views/IndexView.vue";
import LoginView from "@/views/LoginView.vue";
import PostView from "@/views/PostView.vue";
import ZyUnitView from "@/views/ZyUnitView.vue";
import ZyInteractionView from "@/views/ZyInteractionView.vue";
import SysLoginInforView from "@/views/SysLoginInforView.vue";
import SysOperLogView from "@/views/SysOperLogView.vue";
import SysDictType from "@/views/SysDictType.vue";
import SysDictDataView from "@/views/SysDictDataView.vue";
import SuggestView from "@/views/SuggestView.vue";
import ZyRoomView from "@/views/ZyRoomView.vue";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: LoginView
  },
  {
    path: '/login',
    name: 'login',
    component: LoginView
  },

  {
    path: '/main',
    name: 'main',
    component: MainView,
    children:[
      {
        path:'/building',
        name:'building',
        component:BuildingView
      },
      {
        path: '/person',
        name: 'person',
        component: PersonView
      },
      {
        path: '/systemMenu',
        name: 'system/menu/index',
        component: SystemMenuView
      },
        //菜单管理
      {
        path: '/menu',
        name: 'system/menu/index',
        component: SystemMenuView
      },
      {
        path: '/test',
        name: 'test',
        component: TestView
      },
      // 角色管理
      {
        path: '/role',
        name: 'system/role/index',
        component: RoleView
      },
      //   用户管理
      {
        path: '/user',
        name: 'system/user/index',
        component: SysUserView
      },
      //   访客邀请
      {
        path: '/visitor',
        name: 'property/visitor/index',
        component: VisitorView
      },
      //   业主信息
      {
        path: '/owner',
        name: 'property/owner/index',
        component: ZyOwnerView
      },
      {
        path: '/repair',
        name: 'repair',
        component: ZyRepairView
      },
      //   岗位管理
      {
        path: '/post',
        name: 'system/post/index',
        component: PostView
      },
      {
        path: '/index',
        name: 'index',
        component: IndexView
      },
      // 小区信息
      {
        path: "/community",
        name:"property/community/index",
        component: ZyCommunityView
      },
      //   部门管理
      {
        path: '/dept',
        name: 'system/dept/index',
        component:DeptView
      },
      //   单元信息
      {
        path: '/unit',
        name: 'property/unit/index',
        component: ZyUnitView
      },
      {
        path: '/interaction',
        name: 'interaction',
        component: ZyInteractionView
      },
      //   登录日志
      {
        path: '/logininfor',
        name: 'monitor/logininfor/index',
        component: SysLoginInforView
      },

      {
        path: "/ownerRoom",
        name:"zyOwnerRoom",
        component: zyOwnerRoomView
      },
      //   操作日志
      {
        path: "/operlog",
        name:"monitor/operlog/index",
        component: SysOperLogView
      },
      {
        path: "/suggest",
        name: "suggest",
        component: SuggestView
      },
      //   字典管理
      {
        path: "/dict",
        name:"system/dict/index",
        component: SysDictType
      },
      //   字典数据
      {
        path: "/dictData",
        name:"system/dict/data",
        component: SysDictDataView
      },
        //房屋信息
      {
        path: "/room",
        name:"zyRoom",
        component: ZyRoomView
      },

    ]
  },

]

const router = new VueRouter({
  routes
})
// router.beforeEach((to,from,next)=>{
//   if ()
//   console.log(to,"to")
//   console.log(from,"from")
//
// })
export default router
